package com.mym.test;

/**
 * @author miao
 * @version 1.0
 * @date 2025/4/12 14:12
 * @description
 */
public class PetTest2 {

    public static void main(String[] args) {
        Owner1 owner = new Owner1();

        // 创建宠物
        Dog1 dog = new Dog1("旺财", 80, 60, "金毛");
        Penguin penguin = new Penguin("胖胖", 90, 70, "雄性");

        // 喂食测试
        owner.feed(dog);       // 通过多态调用狗狗的eat()
        owner.feed(penguin);   // 通过多态调用企鹅的eat()

        // 验证健康值变化
        System.out.println("\n最终健康值：");
        System.out.println("旺财：" + dog.getHealth());
        System.out.println("胖胖：" + penguin.getHealth());
    }
}


